﻿using Framework.Core.Process.Tasks;
using Xunit;

namespace Framework.Tests.Core.Process.Tasks
{
    public class TaskKillTest
    {
        [Fact]
        public void Should_validate_command_with_name()
        {
            var taskKill = new TaskKill("pouet");

            AssertName(taskKill);
            Assert.Equal("/IM pouet /F /T", taskKill.Arguments);
        }

        [Fact]
        public void Should_validate_command_with_pid()
        {
            var taskKill = new TaskKill(1);

            AssertName(taskKill);
            Assert.Equal("/PID 1 /F /T", taskKill.Arguments);
        }

        private static void AssertName(TaskKill taskKill)
        {
            Assert.Equal("taskkill", taskKill.Name);
            Assert.Equal(@"c:\windows\system32\taskkill.exe", taskKill.FileName);
            Assert.True(taskKill.IsNative);
        }
    }
}